package com.galengao.springboot.validateAndResponse.eneity;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 校验的实体
 *
 * @author GalenGao
 * @version Id: ValidateEntity.java, v 0.1 2022/5/31 9:37 GalenGao Exp $$
 */
@Data
public class ValidateEntity {

    @NotBlank(message = "名称不能为空")
    private String name;

    @NotNull(message = "年龄不能为空")
    @Min(value = 1,message = "年龄必须为正整数")
    private Integer age;

    @NotBlank(message = "地址不能为空")
    private String address;
}
